package h0805;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author 不知名帅哥
 * @version 1.0
 * @description 比较两个版本号的大小
 * @date 2024/8/5 22:22
 */
public class CompareVersionId {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] v1 = sc.nextLine().split("\\.");
        String[] v2 = sc.nextLine().split("\\.");
        int res = getCompare(v1, v2);
        System.out.println(res);
    }

    private static int getCompare(String[] v1, String[] v2) {
        int i = 0;
        while (i < v1.length && i < v2.length) {
            String s1 = v1[i];
            String s2 = v2[i];
            //第一位相等
            if (s1.compareTo(s2) != 0) {
                //
                return compareStr(s1, s2);
            }
            //如果相等就比较下一位
            i++;
        }
        if (v1.length > v2.length) {
            return 1;
        } else if (v1.length < v2.length) {
            return -1;
        }
        return 0;
    }

    private static int compareStr(String s1, String s2) {
        if (s1.startsWith("0")){
            s1=s1.replaceFirst("0+","");
        }
        if (s2.startsWith("0")){
            s2=s2.replaceFirst("0+","");
        }
        int n = s1.length() <= s2.length() ? s1.length() : s2.length();

        for (int i = 0; i < n; i++) {
            char c1 = s1.charAt(i);
            char c2 = s2.charAt(i);

            if (c1 == c2) {
                continue;
            } else if (Character.isLowerCase(c1) && Character.isLowerCase(c2)) {
                return c1 - c2;
            } else if (Character.isUpperCase(c1) && Character.isUpperCase(c2)) {
                return c1 - c2;
            } else if (Character.isDigit(c1) && Character.isDigit(c2)) {
                return c1 - c2;
            } else if (Character.isLowerCase(c1)) {
                return 1;
            } else if (Character.isLowerCase(c2)) {
                return -1;
            }
        }
        return s1.length()-s2.length();
    }
}
